﻿using MiniFox.Components;
using MiniFox.Log.Configurations;

namespace MiniFox.Log
{
    /// <summary>
    /// 
    /// </summary>
    [AutoRegister]
    public abstract class LoggerFactory
    {
        /// <summary>
        /// 
        /// </summary>
        [AutoConfigure]
        protected internal LoggerConfiguration LoggerConfig
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public virtual ILogger CreateLogger()
        {
            var defaultName = LoggerConfig != null ? LoggerConfig.Default : string.Empty;
            return CreateLogger(defaultName);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public abstract ILogger CreateLogger(string name);

    }
}
